package com.baidu.mpks.tree.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
public class UserTreeNode {

    private Integer id;
    @NotBlank(
            message = "名称不能为空"
    )
    @Length(
            message = "名称不能超过50个字",
            min = 1,
            max = 50
    )
    @Pattern(
            regexp = "^[A-Za-z0-9\\u4e00-\\u9fa5\"'“”()（）_.-]+、$",
            message = "名称只支持中英文/数字/双引号/冒号/括号/下划线/短横线/点/顿号"
    )
    private String name;
    private Integer parentId;
    private Integer sort;
    private Integer edit;
    private Integer delete;
    private Integer isEncryption;
    private String createBy;
    private String updateBy;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date createTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date updateTime;
}
